package com.feng.springbootpropertiesdemo2;

import com.feng.springbootpropertiesdemo2.config.BookSettings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 */
@RestController
@SpringBootApplication
public class SpringBootPropertiesDemo2Application {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootPropertiesDemo2Application.class, args);
    }

    @Autowired
    private BookSettings bookSettings;

    @RequestMapping("/")
    public String index() {
        return "book name = " + bookSettings.getName() + ", book price = " + bookSettings.getPrice();
    }

}
